<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Download案例</title>
</head>
<body>
    <select>
        <option>请选择文件</option>
        <option value="1">1.txt</option>
        <option value="2">2.txt</option>
        <option value="3">哈哈.txt</option>
    </select>
    <a href="#">点击下载文件</a>
    <script>
        const selectObj = document.querySelector("select");
        const aObj = document.querySelector("a");
        aObj.addEventListener("click",function () {
            aObj.href = "Day06_response_request_war_exploded/respDownload/demo01?fileName="+selectObj.selectedOptions[0].innerText;
            console.log(aObj.href);
         })
    </script>
</body>
</html>